import java.util.Scanner;

public class Test {
    public static void hanoi(int n,char a,char b,char c){
        if(n==1) {
            System.out.print(a+"->"+c+" ");
        }else{
            hanoi(n-1,a,c,b);
            System.out.printf(a+"->"+c+" ");
            hanoi(n-1,b,a,c);
        }
    }
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入盘子总数：");
        int n = scan.nextInt();
        hanoi(n,'A','B','C');
    }

    public static int max(int n,int m){
        return (n>m? n: m);
    }
    public static double max(double n,double m,double x){
        double max = (n>m? n: m);
        return (max>x? max: x);
    }

    public static void main3(String[] args){
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入两个整数：");
        int n1 = scan.nextInt();
        int n2 = scan.nextInt();
        int max1 = max(n1,n2);
        System.out.println("两个整数的最大值为"+max1);
        System.out.println("请输入三个小数：");
        double a = scan.nextDouble();
        double b = scan.nextDouble();
        double c = scan.nextDouble();
        double max2 = max(a,b,c);
        System.out.println("三个小数的最大值为："+max2);
    }
    public static int add(int n,int m){
        return n + m;
    }
    public static double add(double a,double b,double c){
        return a+b+c;
    }
    public static void main2(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入两个整数：");
        int n = scan.nextInt();
        int m = scan.nextInt();
        int sum = add(n,m);
        System.out.println("两数之和为"+sum);
        System.out.println("请输入三个小数：");
        double n1 = scan.nextDouble();
        double n2 = scan.nextDouble();
        double n3 = scan.nextDouble();
        double ret = add(n1,n2,n3);
        System.out.println("三个小数之和为"+ret);
    }
    public static int max2(int n,int m){
        return (n>m?n:m);
    }

    public static int max3(int a,int b,int c){
        int max = max2(a,b);
        return max2(max,c);
    }

    public static void main1(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入两个整数：");
        int n = scan.nextInt();
        int m = scan.nextInt();
        int max = max2(n,m);
        System.out.println("两个数的最大值为："+ max);

        System.out.println("请输入三个整数：");
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        int m2 = max3(a,b,c);
        System.out.println("三个数的最大值为" + m2);
    }
}
